Skip to content

Shachafl ipython magic patch 1#47

Open
shachafl wants to merge 4 commits intomasterfrom
shachafl-ipython-magic-patch-1
Open

Shachafl ipython magic patch 1#47
shachafl wants to merge 4 commits intomasterfrom
shachafl-ipython-magic-patch-1

Conversation

@shachafl
Copy link
Copy Markdown
Owner

@shachafl shachafl commented Nov 4, 2025

This pull request updates the initialization logic for matplotlib in the dartfish_pipeline.py example to more reliably detect the execution environment and set the appropriate backend. The main change is to distinguish between running in a Jupyter notebook and a terminal IPython session, ensuring that plots display correctly in both contexts.

Environment detection and backend selection:

  • Added a check for 'ipykernel' in sys.modules to determine if the code is running in a Jupyter notebook, and set the matplotlib backend to 'inline' in that case. If running in a terminal IPython session, sets the backend to 'qt5'. (examples/pipelines/dartfish_pipeline.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant